﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tosi
{
    class Individual
    {
        public LightGroup[] I;
        private double TOSI;

        public Individual()
        {
            TOSI = 0;
            I = new LightGroup[Var.JncNumber];
            for (int i = 0; i < Var.JncNumber; i++)
            {
                I[i] = new LightGroup(Var.JUNCTIONS[i]);
            }
        }
        public void countTOSI()
        {
            double sum = 0;
            for (int i = 0; i < I.Length; i++)
            {
                sum += I[i].getGroupTOSI();
            }
            TOSI = sum / I.Length;
        }
        public void setTOSI(double x)
        {
            TOSI = x;
        }
        public double getTOSI()
        {
            return TOSI;
        }
    }
}
